login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > JS > Overige > JVS > Virtuele Subdomeinen Script

JVS > Virtuele Subdomeinen Script

Auteur: Futs - 03 april 2005 - 18:50 - Gekeurd door: XenoX - Hits: 6537 - Aantal punten: (0 stemmen)



Met dit script kun je "virtuele" subdomeinen aanmaken.
Voorbeeld:

http://www.yourdomain.nl

http://inloggen.yourdomain.nl --> wordt doorgezet naar een door jou gekozen locatie
http://webmail.yourdomain.nl --> etc. etc.
etc. etc.

Je kan zoveel subdomeinen aanmaken als je wil mits de host "virtuele" domeinen toestaat.

Code:
  1. <script language="javascript" type="text/javascript">
  2. <!--
  3. // Javascript libary - March 2005 - STFU - Netherlands
  4. // JVS: Javascript Virtual Subdomains
  5.  
  6. var domain, fulldomain, subdomain, location;
  7. domain = document.domain;
  8. subdomain = new Array();
  9. slocation = new Array();
  10.  
  11. // Without http://www. OR https://www.
  12. // ===================================
  13. fulldomain = "yourdomain.nl";
  14.  
  15. // Create as many subdomains as u want
  16. // ===================================
  17. subdomain[0] = "test";
  18. slocation[0] = "http://www.yourdomain.nl/test";
  19.  
  20. subdomain[1] = "images";
  21. slocation[1] = "http://www.yourdomain.nl/images/images.html";
  22.  
  23. subdomain[2] = "private";
  24. slocation[2] = "http://www.yourdomain.nl/privateSection/";
  25.  
  26.  
  27. // Do not edit below this line
  28. // ===========================
  29. function SubDomain() {
  30. for(ArrayCount=0; ArrayCount < subdomain.length; ArrayCount++) {
  31. if(domain == subdomain[ArrayCount]+"."+fulldomain) {
  32. document.location.href=slocation[ArrayCount];
  33. }
  34. }
  35. }
  36. // Onload Function
  37. // ===============
  38. SubDomain();
  39.  
  40. -->
  41. </script>
Download code! Download code (.txt)

 Bekijk een voorbeeld van dit script!
 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (3)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.023s